import Vue from 'vue'
import VueRouter from 'vue-router'


// import home from "@/views/home/index.vue";
// import Login from "@/views/user/login"


const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (location) {
  return originalPush.call(this, location).catch(err => {})
}
Vue.use(VueRouter)


const router = new VueRouter({
  routes:[
    {
      path: '/',
      redirect: "/home"
    },
    // {
    //   path: '/',
    //   name: 'home',
    //   component: home,
    // },
     // {
    //   path: '/wasteShopping',
    //   name: 'wasteShopping',
    //   component: () => import('@/views/wasteShopping/index'),
    // },
    //首页
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/home/index.vue'),
    },
    // {
    //   path: '/home',
    //   name: 'home',
    //   component: () => import('@/views/home/shouye/pageHome.vue'),
    // },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/user/login.vue')
    },
    {
      path: '/user/register',
      name: 'register',
      component: () => import('@/views/user/register'),
    },
    { 
      path: '/userCenter/userInfo',
      name: 'userInfo',
      component: () => import('@/views/userCenter/index.vue'),
    },
    { 
      path: '/helpCenter',
      name: 'help',
      component: () => import('@/views/help/index.vue'),
    },
    {
      path: '/auction',
      name: 'auction',
      component: () => import('@/views/auction/index.vue'),
    },
    {
      path: '/lots',
      name: 'lots',
      component: () => import('@/views/lots/index.vue'),
      
    },
    {
      path: '/quotation',
      name: 'quotation',
      component: () => import('@/views/quotation/index'),
    },
    //中铁闲废资源
    {
      path: '/wasteResource',
      name: 'wasteResource',
      component: () => import('@/views/wasteResource/index'),
    },
    {
      path: '/wasteResource/detail',
      name: 'wasteDetails',
      component: () => import('@/views/wasteResource/detail/index'),
    },
    //循环资源
    {
      path: '/wasteShopping',
      name: 'wasteShopping',
      component: () => import('@/views/wasteShopping/index'),
    },
    {
      path: '/wasteShopping/buyList',
      name: 'buyList',
      component: () => import('@/views/wasteShopping/buyList.vue'),
    },
    {
      path: '/wasteShopping/sellList',
      name: 'sellList',
      component: () => import('@/views/wasteShopping/sellList.vue'),
    },
    {
      path: '/caseLibrary',
      name: 'caseLibrary',
      component: () => import('@/views/caseLibrary/index'),
    },
    {
      path: '/firmIn',
      name: 'firmIn',
      component: () => import('@/views/firmIn/index'),
    },
    {
      path: '/business',
      name: 'business',
      component: () => import('@/views/business/index'),
    },
    
    {
      path: '/lots/detail',
      name: 'detail',
      component: () => import('@/views/lots/detail/index'),
    },
    {
      path: '/lots/registerFor',
      name: 'registerFor',
      component: () => import('@/views/lots/registerFor/index.vue'),
    },
    {
      path: '/auction/detail',
      name: 'auctionDetail',
      component: () => import('@/views/auction/detail/index.vue'),
    },
    {
      path: '/wasteShopping/shopDetails',
      name: 'shopDetails',
      component: () => import('@/views/shopDetails/index.vue'),
    },
    // begShopDetails
    {
      path: '/wasteShopping/begShopDetails',
      name: 'begShopDetails',
      component: () => import('@/views/begShopDetails/index.vue'),
    },
    // applyFor
    {
      path: '/wasteShopping/applyFor',
      name: 'applyFor',
      component: () => import('@/views/wasteShopping/applyFor/index.vue'),
    },
    {
      path:'/actionDjjx',
      name:'actionDjjx',
      component:() => import('@/views/actionDjjx/index.vue')
    },
    {
      path: '/actionDjjx/detail',
      name: 'auctionDetail',
      component: () => import('@/views/actionDjjx/detail/index.vue'),
    },
  ],
})

export default router
